package com.zzw.hj60;

import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 查找组成一个偶数最接近的两个素数
 * @Author: zzw
 */

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static boolean isPrime(int num) {
        if (num <= 1) {
            return false;
        }
        for (int i = 2; i <= num / 2; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int mid = n / 2;
        int p1 = 0;
        int p2 = 0;
        // 从中间往两边找，第一次找到的即为差值最小的
        for (int i = mid; i >= 2; i--) {
            if (isPrime(i)) {
                p1 = i;
                int temp = n - p1;
                if (isPrime(temp)) {
                    p2 = temp;
                    break;
                }
            }
        }
        System.out.println(p1);
        System.out.println(p2);
    }
}
